<!DOCTYPE html>
<html>
    <head>
        <title>reports group</title>
        <meta content="text/html; charset=UTF-8" http-equiv=Content-Type>
        <link rel=stylesheet type=text/css href="<?php echo STATIC_DOMAIN ?>assets/bingo.css">
        <script type="text/javascript">
            var base_url = '<?php echo STATIC_DOMAIN ?>';
        </script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.masked.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.autogrow.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.autogrow.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.maskedinput.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.validate.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/custom.js"></script>
        <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/app.report.js"></script>

        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
        <style type="text/css">
            /*Editable In line*/
/*            .editable {
                width:200px;
                position: absolute;
                z-index: 9999;
            }*/

            .editable select {
                border: 1px solid #C8C8C8;
                padding: 2px 2px 3px;
                color: #666666;
                background: #fff;
                outline: none;
            }

            .editable select option {
                outline: none;
            }

            .editable > button {
                /*font: bold 84% 'trebuchet ms',helvetica,sans-serif;*/
                border: 1px solid #C8C8C8;
                background: #fff;
                text-align: center;
                padding: 2px 8px 3px;
            }

            .editable > input {
                padding: 5px 5px 5px;
                min-width: 100px;
                border: 1px solid #C8C8C8;
                height: auto !important;
            }
            .editTrigger {
                cursor: pointer;
                display: none;
            }
            .weekReport tr td:hover .editTrigger {
                display: inline-block;
            }
            .weekReport tr td {
                padding: 5px 10px;
            }
        </style>
        <?php endif; ?>
    </head>
    <body oncontextmenu=window.event.returnValue=false leftmargin=0 topmargin=0 bgcolor=#ffffff text=#000000 onload="$$.app.report.init()" style="padding-left: 10px">
        <table cellspacing=0 cellpadding=0 width=1000 border=0>
            <tbody>
                <tr>
                    <td class=m_tline height=24>
                        quản lý kế toán <font color="red"><?php echo $parentInfo[0]['acc'] ?></font> &nbsp;ngày tháng: <?php echo date('Y-m-d', strtotime('-7 days')) ?> ~ <?php echo date('Y-m-d') ?> -- <a href="<?php echo site_url('report/weekdata') ?>" target="mainFrame">về trang trước</a>
                    </td>
                </tr>
                <tr>
                    <td height=4>
                    </td>
                </tr>
            </tbody>
        </table>
        <table cellspacing=1 cellpadding=0 width=1100 bgcolor=#000000 border=0 class="weekReport">
            <tbody>
                <tr class=rp_top1 align=center bgcolor=#6b7584>
                    <td height=19 colspan=16>
                        <font color=#ffffff>số tiền tín dụng</font>
                    </td>
                </tr>
                <tr class=rp_top1 align=center bgcolor=#6b7584>
                    <td height=19 width=100>
                        <font color=#ffffff>tài khoản hội viên</font>
                    </td>
                    <td height=19 width=60>
                        <font color=#ffffff>tên</font>
                    </td>
                    <td height=19 width=80>
                        <font color=#ffffff>số lần cược</font>
                    </td>
                    <td height=19 width=85>
                        <font color=#ffffff>tổng tiền cược</font>
                    </td>
                    <td height=19 width=60>
                        <font color=#ffffff>hội viên</font>
                    </td>
                    <td height=19 width=100>
                        <font color=#ffffff>mức cược thực tế</font>
                    </td>
                    <td height=19 width=60>
                        <font color=#ffffff>tỉ lệ cược</font>
                    </td>
                    <td height=19 width=90>
                        <font color=#ffffff>comm</font>
                    </td>
                    <td height=19 width=85>
                        <font color=#ffffff>kết quả</font>
                    </td>
                    <td height=19 width=80>
                        <font color=#ffffff>login 3</font>
                    </td>
                    <td height=19 width=80>
                        <font color=#ffffff>comm login 3</font>
                    </td>
                    <td height=19 width=40>
                        <font color=#ffffff>%</font>
                    </td>
                    <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                        <td>&nbsp;</td>
                    <?php endif; ?>
                </tr>
                <?php 
                    $totalNoBet = 0; 
                    $totalBetRate = 0;
                ?>
                <?php foreach($betSummary as $bet): ?>
                <tr onmouseover="this.bgColor = '#FFCC30';" onmouseout="this.bgColor = '#FFFFFF';" align=right bgcolor=#ffffff data-id="<?php echo $bet['id'] ?>" class="betItem">
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                        <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="acc"><?php echo $bet['acc'] ?></span>
                    </td>
                    <td height="19">
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="name"><?php echo $bet['name'] ?></span>
                    </td>
                    <td height=19>
                        <?php $totalNoBet += $bet['noBet']; ?>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable noBet" data-name="noBet" data-update="true" data-target-update="noBet"><?php printf('%.1f', $bet['noBet']) ?></span>&nbsp;
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <a href="#"><b><?php printf('%.1f', $bet['moneyBet']) ?></b></a>&nbsp;
                        <span class="objEditable" data-name="moneyBet" style="display: none"><?php printf('%.1f', $bet['moneyBet']) ?></b></span>
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="member"><?php printf('%.1f', $bet['member']) ?></span>&nbsp;
                    </td>
                    <td>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="realBet"><?php printf('%.1f', $bet['realBet']) ?></span>
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <?php $totalBetRate += $bet['betRate'] ?>
                        <span class="objEditable betRate" data-name="betRate" data-update="true" data-target-update="betRate"><?php printf('%.1f', $bet['betRate']) ?></span>%&nbsp;
                    </td>
                    <td>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="commMember"><?php printf('%.1f', $bet['commMember']) ?></span>
<!--                        [<a href="javascript:;">chi tiết</a>]-->
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="resultsMember"><?php printf('%.1f', $bet['resultsMember']) ?></span>&nbsp;
                    </td>
                    <td>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="login3"><?php printf('%.1f', $bet['login3']) ?></span> &nbsp;
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="commLogin3"><?php printf('%.1f', $bet['commLogin3']) ?></span> &nbsp;
                    </td>
                    <td height=19>
                        <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                            <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                        <?php endif; ?>
                        <span class="objEditable" data-name="percent"><?php echo $bet['percent'] ?></span>&nbsp;
                    </td>
                    <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                        <td><a href="<?php echo site_url("report/rm/{$bet['id']}?r=" . urlencode('report/group/' . $parentInfo[0]['id'])) ?>" class="removeReport">Xóa</a></td>
                    <?php endif; ?>
                </tr>
                <?php endforeach; ?>
            <tr class=rp_top3 align=right>
                <td height=19 colspan="2">
                    <font color=#cc0000>quy đổi tiền</font>
                    <select class=za_select name=HuiLvs>
                        <option value=7.7525>hkd</option>
                        <option value=10.7492>idr</option>
                        <option value=98.5314>jpy</option>
                        <option value=1237.2277>krw</option>
                        <option value=3.5281>Myr</option>
                        <option value=33.0033>nt</option>
                        <option value=6.8350>rmb</option>
                        <option value=1.4752>sgd</option>
                        <option value=35.0231>thb</option>
                        <option selected value=1.0000>usd</option>
                        <option value=16854.1254>vnd</option>
                    </select>
                </td>
                <td height=19>
                    <span class="noBetTotal"><?php echo floor($totalNoBet) ?></span>&nbsp;
                </td>
                <td id=v2 height=19>
                    &nbsp;
                </td>
                <td id=v3 height=19>
                    &nbsp;
                </td>
                <td id=v9>
                    &nbsp;
                </td>
                <td id=v4 height=19>
                    <span class="betRateTotal"><?php echo floor($totalBetRate) ?></span>%
                </td>
                <td id=v7>
                    &nbsp;
                </td>
                <td id=v8>
                    &nbsp;
                </td>
                <td id=v6 height=19>
                </td>
                <td height=19>
                    &nbsp;
                </td>
                <td height=19>
                    &nbsp;
                </td>
                <?php if(Identity::getInstance()->getRole() == '-1'): ?>
                    <td>&nbsp;</td>
                <?php endif; ?>
            </tr>
        </tbody>
    </table>
    <br>
    <?php if(Identity::getInstance()->getRole() == '-1'): ?>
        <div class="formCreate">
            <input type="button" value="Thêm mới record" class="inputForm addNew"/>
            <div class="content-border" style="">
                <form name="addNewReport" class="addNewReport" method="post" action="<?php echo site_url('report/add') ?>">
                    <label><b>Tên tài khoản</b></label><br/>
                    <input type="text" class="inputForm" id="acc" name="acc" value="" placeholder="Nhập tên tài khoản"/><br/>
                    <label><b>Tên người dùng</b></label><br/>
                    <input type="text" class="inputForm" name="name" id="name" value="" placeholder="Nhập họ tên người dùng"/><br/>
                    <input type="hidden" name="redirect" value="<?php echo site_url('report/group/' . $parentInfo[0]['id']) ?>"/>
                    <input type="hidden" name="parent" value="<?php echo $parentInfo[0]['id'] ?>"/>
                    <input type="submit" value="Tạo" class="inputForm submitForm"/>
                </form>
            </div>
        </div>
    <?php endif; ?>
</body>
</html>